package com.charging.dao;


import com.charging.entity.User;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface UserDao {
    int insert(User user);
    int update(User user);
    int deleteById(Long id);
    User selectById(Long id);
    User selectByUsername(String username);
    List<User> selectAll();
    int updateBalance(@Param("id") Long id, @Param("balance") Double balance);
    int updateStatus(@Param("id") Long id, @Param("status") Integer status);

    boolean findByUsername(String username);

    /**
     * 更新用户位置信息
     */
    int updateUserLocation(@Param("userId") Long userId,
                           @Param("lat") Double lat,
                           @Param("lng") Double lng);

    long count();

    User findByUserNameAndPassword(String username, String password);

    int updateById(User user);
}